#include "../inc/Timer.h"

Timer::Timer(TimedEvent * c, int e, double t)
{
  caller = c;
  event = e;
  target = t;
  elapsed = 0.0;
}

void Timer::update(double dt)
{
  elapsed += dt;
  
  if (elapsed >= target)
  {
    caller->triggerEvent(event);
    this->~Timer();
  }
}
